<template>
  <div>
    <el-table
      :data="memberList"
      style="width: 100%; margin-bottom: 20px"
      row-key="id"
      border
      default-expand-all
      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
    >
      <el-table-column prop="uid" label="用户编号" > </el-table-column>
      <el-table-column prop="nickname" label="昵称" ></el-table-column>
      <el-table-column prop="phone" label="手机号" ></el-table-column>
      <el-table-column label="状态">
        <template v-slot="scoped">
          <div>
            <el-button type="success" v-if="scoped.row.status == 1"
              >启用</el-button
            >
            <el-button type="info" v-else>禁用</el-button>
          </div>
        </template>
      </el-table-column>
       <el-table-column  label="操作">
        <template v-slot="scoped">
          <div>
            <el-button @click="edit(scoped.row.id)">编辑</el-button>
            <el-button @click="del(scoped.row.id)">删除</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
// import {roleDel} from "../../../request/api.js"
// import {sucessAlert,warningAlert} from "../../../utils/alert.js"
export default {
  props: [],
  components: {},
  data() {
    return {
    };
  },
  computed: {
    ...mapGetters({
         memberList:"member/list"
    }),
  },
  methods: {
    ...mapActions({
             asyncMemberList:"member/asynclist"
    }),
    edit(id){
      this.$emit("edit",id)
    }
  },
  mounted() {
      // this.asyncRoleList()
     this.asyncMemberList()
  },
};
</script>
<style scoped>
</style>